Method: Datacite::Mapping::GeoLocationPoint#<=>

Defined in:
lib/datacite/mapping/geo_location_point.rb

#<=>(other) ⇒ Fixnum?

Sorts points from north to south and from east to west, and compares them for equality.

Parameters:

Returns:



65
66
67
68
69
70
71
72
# File 'lib/datacite/mapping/geo_location_point.rb', line 65

def <=>(other)
  return nil unless other.class == self.class
  %i[latitude longitude].each do |c|
    order = send(c) <=> other.send(c)
    return order if order.nonzero?
  end
  0
end